home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Macintosh / Development & Resource Tools / MacsBug6.5.3.sit / MacsBug 6.5.3 / MacsBug 6.5.3 Read Me < prev    next >
Text File  |  1996-02-22  |  18KB  |  365 lines

  1.  About MacsBug 6.5.3
  2.    2/9/96
  3.  
  4.     POWERPC STACK CRAWL
  5.  
  6.      Two bugs were fixed in Mixed Mode “SC6” stack crawls. The stack crawl would always
  7.      terminate when it encountered a 68K to PowerPC switch frame. It would also terminate with
  8.      no output in the PowerPC to PowerPC case if the current routine’s frame hadn’t yet been
  9.      set up.
  10.  
  11.     DISASSEMBLY
  12.  
  13.      When MacsBug is entered because of a crash, it no longer tries to disassemble instructions
  14.      around the current PC if it is at an invalid address (odd, unmapped, etc.). This means
  15.      that if a program somehow jumps into hyperspace, MacsBug won’t eat itself alive with
  16.      another exception. Instead, it will display a helpful message in the PC window area.
  17.  
  18.      The “PlayMem” 512-byte scratch area will now disassemble with a name and offsets.
  19.  
  20.      The ‘…’ character (Option-;) is now a shortcut for the address in the comment field at the
  21.      current PC. This is most useful when you want to disassemble at the target of a branch at
  22.      the current PC. With this shortcut, you no longer have to type the actual address.
  23.  
  24.      The “IL”, “IP”, and “ID” commands support a ‘-c’ parameter, which means “current ISA”. 
  25.      For example, “il -c …” (where ‘…’ means branch target effective address) disassembles using
  26.      the correct disassembler automatically. This feature is best used inside of a macro, and
  27.      the new standard macro “IT” takes advantage of it (see the Macro section below).
  28.  
  29.     POWERPC DISASSEMBLY
  30.  
  31.      Fixed a bug in the PowerPC disassembler front-end logic which would only let you
  32.      disassemble code at addresses after the system heap start and below the last byte of
  33.      contiguous RAM (not logically remapped memory), in PowerPC file mapped space, or in the
  34.      ROM. Any other location would get you an “unable to access that address” message.
  35.  
  36.      Rolled in the latest version of the disassembler. It’s a little smaller, and it fixes a 
  37.      problem where the extended mnemonic “mr.” was incorrectly disassembled as “mr”.
  38.  
  39.      The disassembler now calls the full symbol lookup code when performing effective address
  40.      replacement. This fixes two problems; 1) bls to C++ functions now shows the unmangled
  41.      name, 2) bls to functions not owned by CFM which contain traceback symbols will correctly
  42.      find and use the names.
  43.  
  44.     68K DISASSEMBLY
  45.  
  46.      In 68K disassembly, MacsBug no longer says “will set to ones” for the $50FF instruction
  47.      (it’s an illegal 68K instruction). Added “will trap” and “will not trap” for the various
  48.      trap instructions.
  49.  
  50.     POWERPC EXCEPTIONS
  51.  
  52.      Taking a PowerPC exception no longer trashes the 68K registers D0, A0 and A1. This meant
  53.      that as you stepped PowerPC code, some 68K registers were silently changing.
  54.   
  55.      MacsBug now tries to protect itself from installing its PowerPC exception handler twice.
  56.      This fixes the problem on certain Performa 5200/6200 configurations where you couldn’t
  57.      set breakpoints or step in PowerPC code.
  58.  
  59.     SYMBOL LOOKUP
  60.  
  61.      Sped up the PowerPC and 68K embedded symbol lookup when using the Command-: pop-up
  62.      and when evaluating any name in an expression.
  63.  
  64.      Significantly reworked the embedded symbol lookup code to better deal with areas of code
  65.      that are PowerPC, but aren’t known by CFM (such as accelerated resources). In the past, if
  66.      code wasn’t known by CFM, it was assumed to be 68K, and the PowerPC traceback code was
  67.      never given a chance to find symbols. That could give very misleading information since
  68.      quite often parts of PowerPC tracebacks look like old fixed-length 8-character MacsBug
  69.      names.
  70.  
  71.      Reduced the character space for valid traceback symbols to match embedded 68K symbols.
  72.      This should remove a number of invalid symbols.
  73.  
  74.      When showing what PowerPC fragment an address is within, we now show the byte offset into
  75.      the fragment. This helps when you’re in VM file mapped space and thus not in a heap block.
  76.  
  77.      Rolled in the latest C++ symbol unmangler. It’s way cool, and attempts to make sense out 
  78.      of the varying mangling schemes in the ARM, xlC, MrC, Symantec, and CFront. It does a very
  79.      good job, too.
  80.  
  81.      Refreshing the scrollback area after the Command-: symbols pop-up is dismissed now
  82.      correctly accounts for a scrolled history buffer and doesn’t redraw the wrong text.
  83.  
  84.     REGISTER EVALUATION
  85.  
  86.      I can’t believe this has been broken for so long (all previous versions of MacsBug 6.5).
  87.      When running with VM on, the value to which “SP” and “A7” evaluate was the interrupt
  88.      stack pointer, which is wrong. They now correctly evaluate to the value displayed in the
  89.      regster area for A7.
  90.  
  91.      All 68K Dn and An registers are now valid when in PowerPC code. This means you can now
  92.      display and change them, regardless of the current instruction set. I could go on about
  93.      how this took some serious voodoo magic, but it didn’t.
  94.  
  95.     BREAKPOINTS
  96.  
  97.      Added support for a low-level PowerPC Debugger trap that will stop on the instruction
  98.      after the trap, without modifying any registers. This is useful for stopping in arbitrary
  99.      locations within hand-written assembly code. With this special trap, you don’t have to
  100.      make a cross-TOC call to the high-level Debugger implementation which destroys the
  101.      volatile registers. The trap instruction is:
  102.   
  103.     #define kPowerPCLowLevelDebuggerTrap 0x7F800008 // tw LT|GT|EQ,r0,r0
  104.  
  105.      This trap instruction behaves much like the high-level Debugger call in that it can be
  106.      enabled and disabled with the “DX” (Debugger Exchange) command.
  107.  
  108.      The “BRM” command (Breakpoint Multiple) works again for the first time in years. It was
  109.      broken in the first version of MacsBug 6.5.
  110.  
  111.     STEPPING
  112.  
  113.      Fixed a bug in the mode switching step logic. If you stepped across a PowerPC to 68K
  114.      boundary with a step count or expression (ie. Step until PC = blah), the 68K code on the
  115.      other side was disassembled as PowerPC. The instruction set associated with the current
  116.      PC, which is passed into the disassembler, was synchronized only when a 68K to PowerPC
  117.      switch occurred.
  118.  
  119.      After a step, we now show things of interest that may have changed. Currently MemErr,
  120.      ResErr, and QDErr are watched. If there’s anything else cool we should watch, let us know.
  121.      Here’s a sample line of output when the value of ResErr changed when a Step Over was
  122.      executed:
  123.  
  124.       Step (over) 
  125.         'CODE 0002 08D2' 
  126.            +0274C 00CCFDBC   _GetResource          ; 00049BAE   | A9A0 
  127.                   ••• ResErr changed to #-192 (from #0) 
  128.  
  129.      For drivers that like to call the Memory Manager, we need to save and restore MemErr
  130.      around all of the video driver calls in the step code path. This means MemErr won’t get
  131.      reset to zero as you step.
  132.  
  133.     A-TRAP ACTIONS
  134.  
  135.      Fixed A-Trap actions when tracing over a trap to actually work again. For example, if you
  136.      break on MountVol, and then set an ATB on Read, and then trace over the MountVol, you
  137.      won’t break on Read even though it’s being called a number of times. This was broken in
  138.      MacsBug 6.5.2 in an attempt to fix anther bug. Both are now fixed.
  139.  
  140.      A-Trap disassembly and breaking has been significantly enhanced to support all variants of
  141.      each trap word. For example, we now correctly disassemble the trap word 0xA22E as
  142.      BlockMoveData, and you can now break on it by name. We’d suggest using the new API
  143.      command to browse the full namespace that MacsBug supports for trap display and breaking.
  144.  
  145.      Updated trap selectors for DisplayDispatch, ColorSync 2.0, HFSUtil, FSM, ReleaseFolder,
  146.      QuickTime and SoundDispatch.
  147.  
  148.     API COMMAND
  149.  
  150.      Added a new command, “API”. This command shows anything MacsBug knows about a given
  151.      trap or trap range. It shows if the trap has selectors, what those selectors are, and if they are
  152.      implemented in 68K code, PowerPC, or both. It’s way cool, and will show even more info in
  153.      the future.
  154.  
  155.     HEAP DUMPING
  156.  
  157.      The “HD” command (Heap Dump) has new options that can greatly reduce the number of heap
  158.      blocks you need to examine during debugging. The ‘-s’ and ‘-e’ options allow you to
  159.      constrain the range of addresses that are dumped within the current heap. The ‘-s’ option
  160.      lets you specify the starting address, and ‘-e’ lets you specify the ending address.
  161.      If you use the two options together, ‘-e’ can optionally be used as a byte count. If the
  162.      end is less than the start, it’s a length.
  163.  
  164.      To limit display to blocks of certain sizes, you can use up to two options of the form
  165.      “,<20”. The possible tests are <, =, >, <=, and >=. For example, “HD RS,>1K,<5K” shows
  166.      resource blocks with sizes between 1K and 5K.
  167.  
  168.     COMMAND LINE
  169.  
  170.      The macro “GG” (clear breaks and Go) no longer gets saved into the command-line history.
  171.  
  172.      Made the command line history logic sensitive to case. This is useful such as when you
  173.      capitalize a case-sensitive CFM symbol incorrectly and then repeat the command. The
  174.      corrected version now gets saved in the command history.
  175.  
  176.      Parameter parsing works much better, because binary ‘-’ (subtraction, not negation) can no
  177.      longer have a blank before it. This means that commands such as “RD -f 2 -i 3” now
  178.      work, for example. Previously, it would try to evaluate “2-i”.
  179.  
  180.     MACSBUG PREFERENCES FOLDER
  181.  
  182.      The “MacsBug Preferences” folder can now be located in the same folder as MacsBug (the
  183.      System Folder) or within your “Preferences” folder (actually whatever it’s called, we’re
  184.      international-savvy). You can place your various preferences files within either or both
  185.      of these folders. As before, up to 32 files will be opened (this is the sum total of both
  186.      folders, not 32 per folder).
  187.  
  188.     DCMDS
  189.  
  190.      The PC window now redraws if a dcmd modifies the current PC.
  191.  
  192.      Updated the Errors dcmd to match the latest Errors.h header file. I also rewrote it in C 
  193.      because I was bored one night (yes, that bored).
  194.  
  195.      Fixed two problems in the Leaks dcmd which could cause it to crash on 68K machines. It now
  196.      does Mixed Mode stack crawls only if it’s on a PowerPC machine. The PowerPC crawl now
  197.      validates the back chains as it climbs over switch frames. Updated the display of ISAs to
  198.      be more consistent with MacsBug.
  199.  
  200.      The Gestalt dcmd has been enhanced, and now takes two options. It can be asked to just
  201.      show one selector as in “Gestalt 'sysa'”, and it can just dump the installed selectors
  202.      without calling them as in “Gestalt -n”.
  203.  
  204.      The RD dcmd has a new option, ‘-o’, which turns on display of resource data offsets.
  205.      Some labels have been abbreviated to save space.
  206.  
  207.      The functionality of the StopIf dcmd is now part of MacsBug as a built-in command. The
  208.      external implementation was quite lame in that it poked MacsBug’s globals (incorrectly,
  209.      for the last couple of years).
  210.  
  211.      Fixed a problem where the A7 register as passed to dcmds with VM on is the wrong stack. It
  212.      was always passing the interrupt stack pointer, when it really should be the one shown in
  213.      the register display area as A7.
  214.  
  215.      Universalitized dcmd.h and dcmd.p. All constants are now enums, rather than #defines. The
  216.      input strings to callbacks that are constant are now declared properly. The files are now
  217.      wrapped in the standard C++ and structure alignment goo.
  218.  
  219.      Added the FSInfo dcmd (by Jim Luther), and made it format 3. It has a new option, ‘-t’, 
  220.      which shows a summary table of all installed external file systems.
  221.  
  222.      When warning that you have duplicate dcmds, the compare is now case-insensitive, so we
  223.      don’t miss any.
  224.  
  225.      Updated all of the sample dcmds sample build commands to be current.
  226.  
  227.      Included the latest PowerPC dcmds in their own file, “PowerPC dcmds”.
  228.  
  229.     MACROS
  230.  
  231.      Added MPW SetKey-style key bindings for all extended keyboard function keys. You can
  232.      define macros that get executed when any of the keys are hit. The macros expected are of
  233.      the following form (where ‘n’ is the function key from 1 through 15):
  234.   
  235.        DoFn
  236.        DoCmdFn
  237.        DoOptFn
  238.        DoCmdOptFn
  239.  
  240.      The extended keyboard keys Help, Home, Page Up, Forward-Delete, End, and Page Down are
  241.      now supported. With Help you can type a command name and then Help, and you’ll get that
  242.      specific reference section. Help alone gives you the entire help text (pressing Help
  243.      places a ‘?’ as the first character on the command line and then presses return for you).
  244.  
  245.      Added “cw” and “cwp” macros for breaking into the Metrowerks debugger in 68K and PowerPC
  246.      code, respectively.
  247.  
  248.      The size of the buffer in which you can create macros at runtime has been increased from
  249.      256 bytes to 1K.
  250.  
  251.      The “MC” command (Macro) now wraps output properly, rather than having it extend off of
  252.      the right side of the screen.
  253.  
  254.      Added comments to some common macros, which are now shown if you get help on a macro.
  255.  
  256.      Added a macro named “IT” which disassembles the target effective address at the current
  257.      PC. This is a shortcut for typying “ILP …” or “IL …” (the macro does the right thing and
  258.      gets the instruction set correct).
  259.  
  260.      Added a “TimeTasks” macro for walking though all of the currently pending Time Manager
  261.      tasks.
  262.  
  263.     TEMPLATES
  264.  
  265.      Added some new basic types: SECONDS, ATRAPWORD, BINARY8, BINARY16, BINARY32, and
  266.      OSTYPE. A number of the standard templates were changed to use these new types.
  267.  
  268.      The CGrafPort template now references the portPixMap as a PixMap, rather than a handle.
  269.  
  270.      The IOREFNUM basic type now displays driver names as well as file names.
  271.  
  272.      Duplicate definitions of DCtlEntry and Driver were removed from the standard templates.
  273.  
  274.     LOGGING/STDLOG
  275.  
  276.      MacsBug now knows what version of the system it’s running on when you break into it right
  277.      after it loads. This means log files at boot time will go to the desktop by default (among
  278.      other internal behaviour changes).
  279.  
  280.      The log mechanism has been enhanced to be as robust as it can be, given the runtime
  281.      MacsBug lives in. We now make sure interrupts are enabled when both printing and logging.
  282.      We no longer write data to the log file when the file system is busy (as best as we can
  283.      tell), and you’ll get a warning message if it is. This should clean up a lot of lockups
  284.      if you NMI with logging on. Writes to the log no longer go into the file system cache.
  285.      When writing to the log file, we now flush the volume as well as the file. This way all
  286.      logging actions should stick even if you crash with the file still open.
  287.  
  288.      The “StdLog” macro (and any others that use the SET SUSPENDPROMPT feature) no longer
  289.      randomly starts prompting you to press return again after a dcmd executes.
  290.  
  291.      Fixed the “StdLog” macro so it doesn’t change your current TargetZone (the calls to “HX”
  292.      are now balanced).
  293.  
  294.      The “STAT” command now displays the Gestalt ‘sysu’ (System Update version) value if it’s
  295.      present.
  296.  
  297.     MISCELLANEOUS
  298.  
  299.      Help on the Help command works reliably now.
  300.  
  301.      Added a new SET option, “SIMPLIFIED”. This allows you to toggle the display of PowerPC
  302.      extended mnemonics.
  303.  
  304.      If MacsBug is running on a PowerPC machine, it now ignores what Gestalt says and records
  305.      that the ROM is really 4 MB. This means that using the “WH” command (Where) in the last
  306.      1 MB of the ROM will say it’s in ROM, because it really is. Previous versions of MacsBug
  307.      thought ROMs on PowerPC machines were 3 MB (that’s the size of the 68K portion).
  308.  
  309.      The U.S. KCHR that we distrbute is now the System 7.x one instead of 6.x.
  310.  
  311.      A command of “# ” (pound sign followed by a blank) means the rest of the line is a
  312.      comment. This is useful in macros.
  313.  
  314.      If we have a ‘#’ in front of a decimal constant and fail to convert it, that’s an
  315.      immediate syntax error. We no longer incorrectly proceed to look it up as a symbol.
  316.  
  317.      The machine names list had an incorrect ‘mach’ value for the 8100/100.
  318.  
  319.      Blank Return just scrolls display by one line, so you can now insert blank lines into the
  320.      history if you wish.
  321.  
  322.      The internal processor cache range flush routine now goes to extra efforts to make sure
  323.      that the cache flushing A-Trap it calls is implemented before calling it. This makes “SM”
  324.      (Set Memory) and breakpoints work at boot on older Mac IIs.
  325.  
  326.      The 6100/7100/8100 sound driver bus error fix now only runs on 7.5, 7.5.1, and 7.5.2. The
  327.      real bug has been fixed in System 7.5.3.
  328.  
  329.      The “CS” command (Checksum) now shows the checksum value. The trivially simple 68K
  330.      assembly code to do the checksum is:
  331.   
  332.    ******************************************************************
  333.    ;
  334.    ; pascal long ComputeChecksum(Ptr lowAddr, Ptr highAddr);
  335.    ;
  336.    ;    Calculate checksum over specified address range. Checksum is 
  337.    ;    calculated by summing one byte at a time into a long word
  338.    ;    starting from the low address, and rotating left 1 bit (high
  339.    ;    order bit rotates to low order bit) after each byte is added.
  340.    ;
  341.       
  342.    ComputeChecksum   FUNC    EXPORT
  343.  
  344.                      move.l   (sp)+, d0       ; Return address
  345.                      movea.l  (sp)+, a1       ; High address
  346.                      movea.l  (sp)+, a0       ; Low  address
  347.                      move.l   d0, -(sp)       ; Restore return address
  348.                      moveq    #0, d0
  349.               
  350.    ; Sum bytes in long word, rotating left one bit after each byte is added.
  351.       
  352.    @loop             add.b    (a0)+, d0
  353.                      rol.l    #1, d0
  354.                      cmpa.l   a1, a0
  355.                      ble.s    @loop
  356.                      move.l   d0, 4(sp)
  357.  
  358.                      rts
  359.  
  360.                      ENDF
  361.  
  362.  
  363. © 1996 Apple Computer, Inc. All rights reserved.
  364.  
  365. Apple, the Apple logo, ColorSync, Macintosh, MPW, Performa, Power Macintosh and QuickTime are trademarks of Apple Computer, Inc., registered in the United States and other countries. QuickDraw and Sound Manager are trademarks of Apple Computer, Inc. PowerPC is a trademark of International Business Machines Corporation, used under license therefrom.